package ru.nsu.fit.ask_joe.user_interface_manager;

import android.app.Activity;
import ru.nsu.fit.ask_joe.user_interface_manager.interfaces.IPanel;
import ru.nsu.fit.ask_joe.user_interface_manager.interfaces.IUserInterfaceManager;
import ru.nsu.fit.ask_joe.user_interface_manager.realization.MyQuestionPanel;
import ru.nsu.fit.client.core.response.UserStatisticsData;

public class UserInterfaceManager implements IUserInterfaceManager {
	private final Activity _mainActivity;
	private long _sessionId;
    private UserStatisticsData statistics = null;
	
	public UserInterfaceManager(Activity mainActivity)
	{
		_mainActivity = mainActivity;
	}
	
	@Override
	public void return2home() {
		setCurrentPanel(new MyQuestionPanel());
	}

	@Override
	public void setCurrentPanel(IPanel panel) {
		_mainActivity.setContentView(panel.getView());
	}
	
	@Override
	public Activity getMainActivity() {
		return _mainActivity;
	}

	public long getSessionId() {
		return _sessionId;
	}

	public void setSessionId(long sessionId) {
		_sessionId = sessionId;
	}

    @Override
    public UserStatisticsData getStatistics() {
        return statistics;
    }

    @Override
    public void setStatistics(UserStatisticsData statistics) {
        this.statistics = statistics;
    }

}
